package com.xmall.mapper;

import com.xmall.bean.table.Brand;
import com.xmall.bean.table.Goods;
import com.xmall.bean.table.GoodsExample;
import com.xmall.bean.vo.mallindex.FloorGoodsInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsMapper {

    long countByExample(GoodsExample example);

    int deleteByExample(GoodsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Goods record);

    int insertSelective(Goods record);

    List<Goods> selectByExample(GoodsExample example);

    Goods selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByExample(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKey(Goods record);

    /**
     * 统计商品表里的商品总数
     * @return
     */
    Integer countGoods();

    List<FloorGoodsInfoVo> selectByCategoryId(@Param("id") Integer id);

    Brand queryBrandByGoodsId(@Param("id") Integer id);

}